<#compress>
<!DOCTYPE html>
<html>
	<head>
		<title>权限管理</title>
		<meta name="keywords" content="keyword1,keyword2,keyword3">
		<meta name="description" content="this is my page">
		<meta name="content-type" content="text/html; charset=UTF-8">
		<base href="${webroot}">
		<#include "../../template/easyui.ftl" parse="true" encoding="UTF-8">
		<script type="text/javascript" src="res/rbac/authority.js"></script>
		<script type="text/javascript" src="res/rbac/action_tree_convert.js"></script>
	</head>
	<body>
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'west',split:true,border:false" style="width:20%;">
            	<div class="easyui-panel" style="padding:5px;border: 0px">
					<ul class="easyui-tree" id="module_treeId" style="padding-top: 10px;"
						data-options="
							url: 'authority/authority_navigate_tree.tree',
							method: 'get',
							lines: true,
							loadFilter: convert,
							onSelect: module.onSelectTree,
							onLoadSuccess: module.onLoadSuccessTree
					"></ul>
				</div>
            </div>
			<div data-options="region:'center',border:false">
				<table class="easyui-datagrid" title="" id="module_datagrid"
				  		 data-options="
				  		 	striped:true,
				  		 	border:false,
				  		 	url: 'authority/authority_list.grid',
				  		 	method: 'get',
				  		 	rownumbers: true,
				  		 	pagination: true,
				  		 	fit: true,
				  		 	toolbar: '#tb',
				  		 	onDblClickRow: module.onDblClickRow
				  		 ">
					<thead>
						<tr>
							<th data-options="field:'id',width:50,checkbox:true">ID</th>
							<th data-options="field:'text',width:250">权限名称</th>
							<th data-options="field:'a_status',width:80,align:'center',
								formatter:formatterStatus">状态</th>
							<th data-options="field:'a_order',width:50,align:'center'">排序</th>
							<th data-options="field:'a_remarks',width:350,
								formatter:function(value, row, index) {
									return Common.Util.formatter(value);
								}">备注</th>
						</tr>
					</thead>
				</table>
				<div id="tb" style="padding:5px;height:auto">
					<div style="margin-bottom:5px">
						权限名称: <input id="authorityname" class="easyui-textbox" data-options="prompt:'输入关键字进行查询'" style="width:140px;">
						<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-search" onclick="module.queryDatagrid();">查询</a>
						<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-reload" onclick="module.refreshDatagrid();">刷新</a>
						<br>
						<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-add" action="add" onclick="module.openDialog();">新增</a>
						<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-edit" action="modify" onclick="module.modify();">修改</a>
						<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-seting"  onclick="open_authset_dialog();">权限配置</a>
						<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-ok" action="enable" onclick="module.enable();">启用</a>
						<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-cancel" action="disenable" onclick="module.disenable();">禁用</a>
						<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-no" action="deleted" onclick="module.deleted();">删除</a>
					</div>
				</div>
			</div>
	
			<div id="module_dialog" class="easyui-dialog" title="编辑" style="width:340px;height:380px;padding: 10px;"data-options="resizable:false,modal:true,buttons:'#dlg-buttons',closed:true">
				   <form name="module_from" id="module_from" method="post">
		    			<input type="hidden" name="id" value="">
						<div>
							<font style="font-size: 14px;">权限名称:</font><br>
							<input name="AName" id="AName" maxlength="100" class="easyui-textbox" data-options="required:true" style="width:300px;">
						</div>
			   			<div>
			   				<font style="font-size: 14px;">上级权限:</font><br>
							<input name="AParentid" id="AParentid" class="easyui-combotree"
							data-options="
								url: 'authority/authority_navigate_tree.tree',
								method: 'get',
								lines: true,
								required : true,
								loadFilter: convertTreeAppendRoot"
							style="width:300px;">
			   			</div>
			   			
			   			<div>
							<font style="font-size: 14px;">排序:</font><br>
							<input name="AOrder" id="AOrder" maxlength="11" class="easyui-numberbox" style="width:300px;">
			   			</div>
			   			
						<div>
							<font style="font-size: 14px;">备注:</font><br>
							<input name="ARemarks" id="ARemarks" data-options="multiline:true" maxlength="200" class="easyui-textbox" style="width:300px;height:130px">
						</div>
					</form>  
			<div id="dlg-buttons">
				<a href="javascript:void(0)" class="easyui-linkbutton" onclick="module.edit()">保存</a>
				<a href="javascript:void(0)" class="easyui-linkbutton" onclick="module.closeDialog()">取消</a>
			</div>
		</div>
		<!-- end edit dialog -->
		<div id="auth_set_dialog" class="easyui-dialog" title="编辑" style="width:1100px;height:500px;"data-options="resizable:false,modal:true,closed:true">
			<div  class="easyui-layout" data-options="fit:true">   
				    <div data-options="region:'west',split:true,border:false" style="width:250px;padding: 15px;">
						<ul class="easyui-tree" id="action_native_tree"
								data-options="
									url:'action/action_native_tree.tree?current_system=${current_system!"rbac"}',
									method: 'post',
									lines: true,
									checkbox: false,
									loadFilter: ActionTreeConvert,
									onSelect:action_nav_tree_select
							"></ul>
				    </div>   
				    <div data-options="region:'center',border:false" >
				    	<table class="easyui-datagrid" title="" id="action_choose_grid"
				  		 data-options="
				  		 	striped:true,
				  		 	border:false,
				  		 	url: 'authority/action_choose_list.grid?current_system=${current_system!"rbac"}',
				  		 	method: 'get',
				  		 	rownumbers: true,
				  		 	pagination: true,
				  		 	fit: true,
				  		 	toolbar:'#auth_set_toolbar',
				  		 	rowStyler:authSetRowstyler
				  		 ">
							<thead style="">
								<tr>
									<th data-options="field:'id',width:50,checkbox:true">ID</th>
									<th data-options="field:'a_name',width:200,formatter:formatterActionType">名称</th>
									<th data-options="field:'parent',width:120">上一级</th>
									<th data-options="field:'a_url',width:120">URL</th>
									<th data-options="field:'flag',width:50">flag</th>
									<th data-options="field:'a_remarks',width:350,
										formatter:function(value, row, index) {
											return Common.Util.formatter(value);
										}">备注</th>
								</tr>
							</thead>
						</table>
						<div id="auth_set_toolbar">
							<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-load" onclick="$('#actiontree').tree('expandAll');;">展开</a>
							<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-load" onclick="$('#actiontree').tree('collapseAll');;">收缩</a>
							<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-add" action="add" onclick="resBindAuth();">添加</a>
							<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-cancel" action="disenable" onclick="deleteAuthOfRes();">移除</a>
							备注:(蓝色行代表包含在权限中)
							关键字: <input id="keywordinput" class="easyui-textbox" data-options="prompt:'输入关键字进行查询'" style="width:140px;">
							<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-search" onclick="keyWordQuery();">查询</a><br>
						</div>
				    </div>   
			</div>
		</div>
		
	</body>
</html>
</#compress>